module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const PaymentSchema = new Schema({
        title: { // 支付名称
            type: String
        },
        type: { // 支付方式 0: 免费 1:礼物 2: 积分 3: 金钱 RMB
            type: Number,
            default: 0,
            required: true
        },
        creator: { type: Schema.Types.ObjectId, ref: 'User' }, // 作者
        amount: { // 支付的数量
            type: Number,
            default: 0,
            required: true
        }
    }, { timestamps: { createdAt: 'createDate', updatedAt: 'updateDate' } });
    return mongoose.model('Payment', PaymentSchema);
};